<script language='javascript'>
    var winForm;
    function test(){
        console.log('sdkjndskjfn')
    }
    $(document).ready(function() {
        $("#flex1").flexigrid({
            url: BASE_URL+'resources/loadGrid',
            dataType: 'json',
            colModel : [
                {display: 'Nombre', name : 'name', width : 40, sortable : true, align: 'center'},
                {display: 'Costo', name : 'cost', width : 180, sortable : true, align: 'left'},
                {display: 'Cantidad', name : 'quantity', width : 120, sortable : true, align: 'left'},
                {display: 'Unidad', name : 'symbol', width : 130, sortable : false, align: 'left'},
                {display: 'id', name : 'id', width : 80, sortable : true, align: 'right', hide:true}
            ],
            buttons : [
                {
                    name: 'Add', 
                    bclass: 'add', 
                    onpress : function(){
                        $("#dform").css('display','block');
                    }
                },
                {name: 'Delete', bclass: 'delete', onpress : test},
                {separator: true}
            ],
            searchitems : [
                {display: 'Nombre', name : 'name', isdefault: true}
            ],
            sortname: "name",
            sortorder: "asc",
            usepager: true,
            title: 'Insumos',
            useRp: true,
            rp: 15,
            showTableToggleBtn: true,
            width: 700,
            height: 200
        });   
    });
</script>
<?php echo utf8_decode($module_banner); ?>
<div style="display: none;background-color: white;" id="dform">
    <form class="form-horizontal">
        <div class="control-group">
            <label class="control-label" for="iname">Nombre</label>
            <div class="controls">
                <input type="text" id="iname" placeholder="Nombre" name="name">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="icost">Costo</label>
            <div class="controls">
                <input type="text" id="icost" placeholder="Costo" name="cost">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="iquantity">Cantidad</label>
            <div class="controls">
                <input type="text" id="iquantity" placeholder="Cantidad" name="quantity">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inuits_id">Unidad</label>
            <div class="controls">
                <select id="inuits_id" placeholder="Unidad" name="units_id">
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>4</option>
                    <option>5</option>
                </select>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <label class="checkbox">
                    <input type="checkbox"> Remember me
                </label>
                <button type="submit" class="btn btn-primary">Sign in</button>
            </div>
        </div>
    </form>
</div>
<ul class='ul_page'>
    <li><div id='flex1'></div></li>
</ul>
